<%--
  Created by IntelliJ IDEA.
  User: lujw
  Date: 2017/6/14
  Time: 19:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/hospital_token.jsp"%>
<%
    //阅读通知
    String readTime = DateUtil.formatDateByFormat(new Date(), DateUtil.DATETIME_FORMAT);
    Integer uid = token.getUid();
    Integer noticeId = input.getInt("notice_id", -1);
    List<HospitalNoticeFeedback> feedbackList = QBuilder.db("basedb").select().from("HospitalNoticeFeedback").where(new Where("userId=", uid).and("noticeId=", noticeId).and("status=", ConstantUtil.STATUS_ENABLE).and("hospital=", hospital)).page(1, 1).query().getResultObj();
    if (feedbackList.size() == 0) {
        ErrcodeUtil.setErrcode(msg, ErrcodeUtil.FAILURE);
        Tools.encryptPrint(out, msg);
        return;
    }
    HospitalNoticeFeedback feedback = feedbackList.get(0);
    if (Objects.isNull(feedback.getReadTime()) || "".equals(feedback.getReadTime())) {
        feedback.setReadTime(readTime);
        DBTools.db("basedb").modItem(feedback, feedback.getId());
    }
    Tools.encryptPrint(out, msg);
%>
